<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hbuilder构建跨平台的移动app," />










<meta name="description" content="​    现在我们要开发一款通用的app，如果web端需要写，安卓、ios也需要写。这样岂不是太麻烦，也增加了公司的开发成本。于是乎就有了能跨平台的东西出来，所有的平台只需要写一次就ok。今天在这里我就介绍一下使用Hbuilder构建跨平台的移动app。需要准备的东西如下： 安装Hbuilder软件，这里不多介绍了。软件下载地址 下载好之后我们还要准备好自己要打包的项目。 一、安装Hbuilder">
<meta name="keywords" content="Hbuilder构建跨平台的移动app">
<meta property="og:type" content="article">
<meta property="og:title" content="使用Hbuilder构建跨平台的移动app">
<meta property="og:url" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/index.html">
<meta property="og:site_name" content="Mr. Lee&#39;s blog">
<meta property="og:description" content="​    现在我们要开发一款通用的app，如果web端需要写，安卓、ios也需要写。这样岂不是太麻烦，也增加了公司的开发成本。于是乎就有了能跨平台的东西出来，所有的平台只需要写一次就ok。今天在这里我就介绍一下使用Hbuilder构建跨平台的移动app。需要准备的东西如下： 安装Hbuilder软件，这里不多介绍了。软件下载地址 下载好之后我们还要准备好自己要打包的项目。 一、安装Hbuilder">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/1.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/2.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/3.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/4.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/5.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/6.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/7.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/8.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/9.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/10.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/11.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/12.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/13.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/14.png">
<meta property="og:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/15.png">
<meta property="og:updated_time" content="2018-10-27T02:35:39.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用Hbuilder构建跨平台的移动app">
<meta name="twitter:description" content="​    现在我们要开发一款通用的app，如果web端需要写，安卓、ios也需要写。这样岂不是太麻烦，也增加了公司的开发成本。于是乎就有了能跨平台的东西出来，所有的平台只需要写一次就ok。今天在这里我就介绍一下使用Hbuilder构建跨平台的移动app。需要准备的东西如下： 安装Hbuilder软件，这里不多介绍了。软件下载地址 下载好之后我们还要准备好自己要打包的项目。 一、安装Hbuilder">
<meta name="twitter:image" content="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/1.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/"/>





  <title>使用Hbuilder构建跨平台的移动app | Mr. Lee's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Mr. Lee's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description">知识改变命运,技术成就梦想</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/404.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
            
            公益404
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/10/25/使用Hbuilder构建跨平台的移动app/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Mr. Lee">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Mr. Lee's blog">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">使用Hbuilder构建跨平台的移动app</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-10-25T21:14:15+08:00">
                2018-10-25
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  2,636
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  12
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>​    现在我们要开发一款通用的app，如果web端需要写，安卓、ios也需要写。这样岂不是太麻烦，也增加了公司的开发成本。于是乎就有了能跨平台的东西出来，所有的平台只需要写一次就ok。今天在这里我就介绍一下使用Hbuilder构建跨平台的移动app。需要准备的东西如下：</p>
<p>安装Hbuilder软件，这里不多介绍了。软件<a href="http://www.dcloud.io/" target="_blank" rel="noopener">下载地址</a></p>
<p>下载好之后我们还要准备好自己要打包的项目。</p>
<h5 id="一、安装Hbuilder"><a href="#一、安装Hbuilder" class="headerlink" title="一、安装Hbuilder"></a>一、安装Hbuilder</h5><p>​    此处省略。不是本文重点，有关安装问题自行百度。</p>
<h5 id="二、打开Hbuilder"><a href="#二、打开Hbuilder" class="headerlink" title="二、打开Hbuilder"></a>二、打开Hbuilder</h5><p>​    选中红色区域内新建项目</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/1.png" alt="1"></p>
<p>​    会弹出如下界面</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/2.png" alt="2"></p>
<p>​    填好名称和路径然后点击创建。创建好之后项目的目录结构如下</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/3.png" alt="3"></p>
<h5 id="三、编辑好项目代码"><a href="#三、编辑好项目代码" class="headerlink" title="三、编辑好项目代码"></a>三、编辑好项目代码</h5><p>整理好需要打包的项目代码。主要为了测试打包。简单的测试代码</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/4.png" alt="1540448632068"></p>
<h5 id="四、进行manifest-json配置"><a href="#四、进行manifest-json配置" class="headerlink" title="四、进行manifest.json配置"></a>四、进行manifest.json配置</h5><h6 id="基础配置"><a href="#基础配置" class="headerlink" title="基础配置"></a>基础配置</h6><p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/5.png" alt="5"></p>
<h6 id="图标配置"><a href="#图标配置" class="headerlink" title="图标配置"></a>图标配置</h6><p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/6.png" alt="6"></p>
<p>点击自动生成所有图标并替换就会生成下面所有的图标。也可以自己制作对应的图片</p>
<h6 id="启动图配置"><a href="#启动图配置" class="headerlink" title="启动图配置"></a>启动图配置</h6><p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/7.png" alt="7"></p>
<p>下面的图片尺寸大小需要自己设计好。延时按照要求设置对应的数值就可以。</p>
<h6 id="SDK配置"><a href="#SDK配置" class="headerlink" title="SDK配置"></a>SDK配置</h6><p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/8.png" alt="8"></p>
<p>这个地方根据自己的需求去配置相应的值。</p>
<h6 id="模块权限配置"><a href="#模块权限配置" class="headerlink" title="模块权限配置"></a>模块权限配置</h6><p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/9.png" alt="9"></p>
<p>配置软件获取的系统权限</p>
<h6 id="源码视图"><a href="#源码视图" class="headerlink" title="源码视图"></a>源码视图</h6><p>主要查看上面的配置的json文件。如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    &quot;@platforms&quot; : [ &quot;android&quot;, &quot;iPhone&quot;, &quot;iPad&quot; ],</span><br><span class="line">    &quot;id&quot; : &quot;H590E31E9&quot;, /*应用的标识*/</span><br><span class="line">    &quot;name&quot; : &quot;my_demo&quot;, /*应用名称，程序桌面图标名称*/</span><br><span class="line">    &quot;version&quot; : &#123;</span><br><span class="line">        &quot;name&quot; : &quot;1.0&quot;, /*应用版本名称*/</span><br><span class="line">        &quot;code&quot; : 1</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;description&quot; : &quot;第一个测试的app&quot;, /*应用描述信息*/</span><br><span class="line">    &quot;icons&quot; : &#123;</span><br><span class="line">        &quot;72&quot; : &quot;icon.png&quot;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;launch_path&quot; : &quot;index.html&quot;, /*应用的入口页面，默认为根目录下的index.html；支持网络地址，必须以http://或https://开头*/</span><br><span class="line">    &quot;developer&quot; : &#123;</span><br><span class="line">        &quot;name&quot; : &quot;&quot;, /*开发者名称*/</span><br><span class="line">        &quot;email&quot; : &quot;&quot;, /*开发者邮箱地址*/</span><br><span class="line">        &quot;url&quot; : &quot;&quot; /*开发者个人主页地址*/</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;permissions&quot; : &#123;</span><br><span class="line">        &quot;Accelerometer&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问加速度感应器&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Audio&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问麦克风&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Messaging&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;短彩邮件插件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Cache&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理应用缓存&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Camera&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问摄像头&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Console&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;跟踪调试输出日志&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Contacts&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问系统联系人信息&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Device&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问设备信息&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Downloader&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;文件下载管理&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Events&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;应用扩展事件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;File&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问本地文件系统&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Gallery&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问系统相册&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Geolocation&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问位置信息&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Invocation&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;使用Native.js能力&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Orientation&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问方向感应器&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Proximity&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问距离感应器&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Storage&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理应用本地数据&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Uploader&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理文件上传任务&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Runtime&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;访问运行期环境&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;XMLHttpRequest&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;跨域网络访问&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Zip&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;文件压缩与解压缩&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Barcode&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理二维码扫描插件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Maps&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理地图插件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Speech&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;管理语音识别插件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Webview&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;窗口管理&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;NativeUI&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;原生UI控件&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;Navigator&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;浏览器信息&quot;</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;NativeObj&quot; : &#123;</span><br><span class="line">            &quot;description&quot; : &quot;原生对象&quot;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;,</span><br><span class="line">    &quot;plus&quot; : &#123;</span><br><span class="line">        &quot;splashscreen&quot; : &#123;</span><br><span class="line">            &quot;autoclose&quot; : true, /*是否自动关闭程序启动界面，true表示应用加载应用入口页面后自动关闭；false则需调plus.navigator.closeSplashscreen()关闭*/</span><br><span class="line">            &quot;waiting&quot; : true, /*是否在程序启动界面显示等待雪花，true表示显示，false表示不显示。*/</span><br><span class="line">            &quot;delay&quot; : 3000</span><br><span class="line">        &#125;,</span><br><span class="line">        &quot;popGesture&quot; : &quot;close&quot;, /*设置应用默认侧滑返回关闭Webview窗口，&quot;none&quot;为无侧滑返回功能，&quot;hide&quot;为侧滑隐藏Webview窗口。参考http://ask.dcloud.net.cn/article/102*/</span><br><span class="line">        &quot;runmode&quot; : &quot;normal&quot;, /*应用的首次启动运行模式，可取liberate或normal，liberate模式在第一次启动时将解压应用资源（Android平台File API才可正常访问_www目录）*/</span><br><span class="line">        &quot;signature&quot; : &quot;Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==&quot;, /*可选，保留给应用签名，暂不使用*/</span><br><span class="line">        &quot;distribute&quot; : &#123;</span><br><span class="line">            &quot;apple&quot; : &#123;</span><br><span class="line">                &quot;appid&quot; : &quot;&quot;, /*iOS应用标识，苹果开发网站申请的appid，如io.dcloud.HelloH5*/</span><br><span class="line">                &quot;mobileprovision&quot; : &quot;&quot;, /*iOS应用打包配置文件*/</span><br><span class="line">                &quot;password&quot; : &quot;&quot;, /*iOS应用打包个人证书导入密码*/</span><br><span class="line">                &quot;p12&quot; : &quot;&quot;, /*iOS应用打包个人证书，打包配置文件关联的个人证书*/</span><br><span class="line">                &quot;devices&quot; : &quot;universal&quot;, /*iOS应用支持的设备类型，可取值iphone/ipad/universal*/</span><br><span class="line">                &quot;frameworks&quot; : [] /*调用Native.js调用原生Objective-c API需要引用的FrameWork，如需调用GameCenter，则添加&quot;GameKit.framework&quot;*/</span><br><span class="line">            &#125;,</span><br><span class="line">            &quot;google&quot; : &#123;</span><br><span class="line">                &quot;packagename&quot; : &quot;&quot;, /*Android应用包名，如io.dcloud.HelloH5*/</span><br><span class="line">                &quot;keystore&quot; : &quot;&quot;, /*Android应用打包使用的密钥库文件*/</span><br><span class="line">                &quot;password&quot; : &quot;&quot;, /*Android应用打包使用密钥库中证书的密码*/</span><br><span class="line">                &quot;aliasname&quot; : &quot;&quot;, /*Android应用打包使用密钥库中证书的别名*/</span><br><span class="line">                &quot;permissions&quot; : [</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.CHANGE_NETWORK_STATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.MOUNT_UNMOUNT_FILESYSTEMS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.READ_CONTACTS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.VIBRATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.READ_LOGS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.ACCESS_WIFI_STATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-feature android:name=\&quot;android.hardware.camera.autofocus\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.WRITE_CONTACTS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.ACCESS_NETWORK_STATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.CAMERA\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.RECORD_AUDIO\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.GET_ACCOUNTS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.MODIFY_AUDIO_SETTINGS\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.READ_PHONE_STATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.CHANGE_WIFI_STATE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.WAKE_LOCK\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.CALL_PHONE\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.FLASHLIGHT\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.ACCESS_COARSE_LOCATION\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-feature android:name=\&quot;android.hardware.camera\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.ACCESS_FINE_LOCATION\&quot;/&gt;&quot;,</span><br><span class="line">                    &quot;&lt;uses-permission android:name=\&quot;android.permission.WRITE_SETTINGS\&quot;/&gt;&quot;</span><br><span class="line">                ]</span><br><span class="line">            &#125;,</span><br><span class="line">            /*使用Native.js调用原生安卓API需要使用到的系统权限*/</span><br><span class="line">            &quot;orientation&quot; : [ &quot;portrait-primary&quot; ], /*应用支持的方向，portrait-primary：竖屏正方向；portrait-secondary：竖屏反方向；landscape-primary：横屏正方向；landscape-secondary：横屏反方向*/</span><br><span class="line">            &quot;icons&quot; : &#123;</span><br><span class="line">                &quot;ios&quot; : &#123;</span><br><span class="line">                    &quot;prerendered&quot; : true, /*应用图标是否已经高亮处理，在iOS6及以下设备上有效*/</span><br><span class="line">                    &quot;auto&quot; : &quot;&quot;, /*应用图标，分辨率：512x512，用于自动生成各种尺寸程序图标*/</span><br><span class="line">                    &quot;iphone&quot; : &#123;</span><br><span class="line">                        &quot;normal&quot; : &quot;&quot;, /*iPhone3/3GS程序图标，分辨率：57x57*/</span><br><span class="line">                        &quot;retina&quot; : &quot;&quot;, /*iPhone4程序图标，分辨率：114x114*/</span><br><span class="line">                        &quot;retina7&quot; : &quot;&quot;, /*iPhone4S/5/6程序图标，分辨率：120x120*/</span><br><span class="line">                        &quot;retina8&quot; : &quot;&quot;, /*iPhone6 Plus程序图标，分辨率：180x180*/</span><br><span class="line">                        &quot;spotlight-normal&quot; : &quot;&quot;, /*iPhone3/3GS Spotlight搜索程序图标，分辨率：29x29*/</span><br><span class="line">                        &quot;spotlight-retina&quot; : &quot;&quot;, /*iPhone4 Spotlight搜索程序图标，分辨率：58x58*/</span><br><span class="line">                        &quot;spotlight-retina7&quot; : &quot;&quot;, /*iPhone4S/5/6 Spotlight搜索程序图标，分辨率：80x80*/</span><br><span class="line">                        &quot;settings-normal&quot; : &quot;&quot;, /*iPhone4设置页面程序图标，分辨率：29x29*/</span><br><span class="line">                        &quot;settings-retina&quot; : &quot;&quot;, /*iPhone4S/5/6设置页面程序图标，分辨率：58x58*/</span><br><span class="line">                        &quot;settings-retina8&quot; : &quot;&quot;, /*iPhone6Plus设置页面程序图标，分辨率：87x87*/</span><br><span class="line">                        &quot;app@2x&quot; : &quot;unpackage/res/icons/120x120.png&quot;,</span><br><span class="line">                        &quot;app@3x&quot; : &quot;unpackage/res/icons/180x180.png&quot;,</span><br><span class="line">                        &quot;notification@2x&quot; : &quot;unpackage/res/icons/40x40.png&quot;,</span><br><span class="line">                        &quot;notification@3x&quot; : &quot;unpackage/res/icons/60x60.png&quot;,</span><br><span class="line">                        &quot;settings@2x&quot; : &quot;unpackage/res/icons/58x58.png&quot;,</span><br><span class="line">                        &quot;settings@3x&quot; : &quot;unpackage/res/icons/87x87.png&quot;,</span><br><span class="line">                        &quot;spotlight@2x&quot; : &quot;unpackage/res/icons/80x80.png&quot;,</span><br><span class="line">                        &quot;spotlight@3x&quot; : &quot;unpackage/res/icons/120x120.png&quot;</span><br><span class="line">                    &#125;,</span><br><span class="line">                    &quot;ipad&quot; : &#123;</span><br><span class="line">                        &quot;normal&quot; : &quot;&quot;, /*iPad普通屏幕程序图标，分辨率：72x72*/</span><br><span class="line">                        &quot;retina&quot; : &quot;&quot;, /*iPad高分屏程序图标，分辨率：144x144*/</span><br><span class="line">                        &quot;normal7&quot; : &quot;&quot;, /*iPad iOS7程序图标，分辨率：76x76*/</span><br><span class="line">                        &quot;retina7&quot; : &quot;&quot;, /*iPad iOS7高分屏程序图标，分辨率：152x152*/</span><br><span class="line">                        &quot;spotlight-normal&quot; : &quot;&quot;, /*iPad Spotlight搜索程序图标，分辨率：50x50*/</span><br><span class="line">                        &quot;spotlight-retina&quot; : &quot;&quot;, /*iPad高分屏Spotlight搜索程序图标，分辨率：100x100*/</span><br><span class="line">                        &quot;spotlight-normal7&quot; : &quot;&quot;, /*iPad iOS7 Spotlight搜索程序图标，分辨率：40x40*/</span><br><span class="line">                        &quot;spotlight-retina7&quot; : &quot;&quot;, /*iPad iOS7高分屏Spotlight搜索程序图标，分辨率：80x80*/</span><br><span class="line">                        &quot;settings-normal&quot; : &quot;&quot;, /*iPad设置页面程序图标，分辨率：29x29*/</span><br><span class="line">                        &quot;settings-retina&quot; : &quot;&quot;, /*iPad高分屏设置页面程序图标，分辨率：58x58*/</span><br><span class="line">                        &quot;app&quot; : &quot;unpackage/res/icons/76x76.png&quot;,</span><br><span class="line">                        &quot;app@2x&quot; : &quot;unpackage/res/icons/152x152.png&quot;,</span><br><span class="line">                        &quot;notification&quot; : &quot;unpackage/res/icons/20x20.png&quot;,</span><br><span class="line">                        &quot;notification@2x&quot; : &quot;unpackage/res/icons/40x40.png&quot;,</span><br><span class="line">                        &quot;proapp@2x&quot; : &quot;unpackage/res/icons/167x167.png&quot;,</span><br><span class="line">                        &quot;settings&quot; : &quot;unpackage/res/icons/29x29.png&quot;,</span><br><span class="line">                        &quot;settings@2x&quot; : &quot;unpackage/res/icons/58x58.png&quot;,</span><br><span class="line">                        &quot;spotlight&quot; : &quot;unpackage/res/icons/40x40.png&quot;,</span><br><span class="line">                        &quot;spotlight@2x&quot; : &quot;unpackage/res/icons/80x80.png&quot;</span><br><span class="line">                    &#125;,</span><br><span class="line">                    &quot;appstore&quot; : &quot;img/logo.png&quot;</span><br><span class="line">                &#125;,</span><br><span class="line">                &quot;android&quot; : &#123;</span><br><span class="line">                    &quot;mdpi&quot; : &quot;unpackage/res/icons/48x48.png&quot;, /*普通屏程序图标，分辨率：48x48*/</span><br><span class="line">                    &quot;ldpi&quot; : &quot;unpackage/res/icons/48x48.png&quot;, /*大屏程序图标，分辨率：48x48*/</span><br><span class="line">                    &quot;hdpi&quot; : &quot;unpackage/res/icons/72x72.png&quot;, /*高分屏程序图标，分辨率：72x72*/</span><br><span class="line">                    &quot;xhdpi&quot; : &quot;unpackage/res/icons/96x96.png&quot;, /*720P高分屏程序图标，分辨率：96x96*/</span><br><span class="line">                    &quot;xxhdpi&quot; : &quot;unpackage/res/icons/144x144.png&quot;, /*1080P 高分屏程序图标，分辨率：144x144*/</span><br><span class="line">                    &quot;xxxhdpi&quot; : &quot;unpackage/res/icons/192x192.png&quot;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;,</span><br><span class="line">            &quot;splashscreen&quot; : &#123;</span><br><span class="line">                &quot;ios&quot; : &#123;</span><br><span class="line">                    &quot;iphone&quot; : &#123;</span><br><span class="line">                        &quot;default&quot; : &quot;&quot;, /*iPhone3启动图片选，分辨率：320x480*/</span><br><span class="line">                        &quot;retina35&quot; : &quot;&quot;, /*3.5英寸设备(iPhone4)启动图片，分辨率：640x960*/</span><br><span class="line">                        &quot;retina40&quot; : &quot;&quot;, /*4.0 英寸设备(iPhone5/iPhone5s)启动图片，分辨率：640x1136*/</span><br><span class="line">                        &quot;retina47&quot; : &quot;&quot;, /*4.7 英寸设备(iPhone6)启动图片，分辨率：750x1334*/</span><br><span class="line">                        &quot;retina55&quot; : &quot;&quot;, /*5.5 英寸设备(iPhone6 Plus)启动图片，分辨率：1242x2208*/</span><br><span class="line">                        &quot;retina55l&quot; : &quot;&quot; /*5.5 英寸设备(iPhone6 Plus)横屏启动图片，分辨率：2208x1242*/</span><br><span class="line">                    &#125;,</span><br><span class="line">                    &quot;ipad&quot; : &#123;</span><br><span class="line">                        &quot;portrait&quot; : &quot;&quot;, /*iPad竖屏启动图片，分辨率：768x1004*/</span><br><span class="line">                        &quot;portrait-retina&quot; : &quot;&quot;, /*iPad高分屏竖屏图片，分辨率：1536x2008*/</span><br><span class="line">                        &quot;landscape&quot; : &quot;&quot;, /*iPad横屏启动图片，分辨率：1024x748*/</span><br><span class="line">                        &quot;landscape-retina&quot; : &quot;&quot;, /*iPad高分屏横屏启动图片，分辨率：2048x1496*/</span><br><span class="line">                        &quot;portrait7&quot; : &quot;&quot;, /*iPad iOS7竖屏启动图片，分辨率：768x1024*/</span><br><span class="line">                        &quot;portrait-retina7&quot; : &quot;&quot;, /*iPad iOS7高分屏竖屏图片，分辨率：1536x2048*/</span><br><span class="line">                        &quot;landscape7&quot; : &quot;&quot;, /*iPad iOS7横屏启动图片，分辨率：1024x768*/</span><br><span class="line">                        &quot;landscape-retina7&quot; : &quot;&quot; /*iPad iOS7高分屏横屏启动图片，分辨率：2048x1536*/</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;,</span><br><span class="line">                &quot;android&quot; : &#123;</span><br><span class="line">                    &quot;mdpi&quot; : &quot;&quot;, /*普通屏启动图片，分辨率：240x282*/</span><br><span class="line">                    &quot;ldpi&quot; : &quot;&quot;, /*大屏启动图片，分辨率：320x442*/</span><br><span class="line">                    &quot;hdpi&quot; : &quot;&quot;, /*高分屏启动图片，分辨率：480x762*/</span><br><span class="line">                    &quot;xhdpi&quot; : &quot;&quot;, /*720P高分屏启动图片，分辨率：720x1242*/</span><br><span class="line">                    &quot;xxhdpi&quot; : &quot;&quot; /*1080P高分屏启动图片，分辨率：1080x1882*/</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;,</span><br><span class="line">            &quot;plugins&quot; : &#123;</span><br><span class="line">                &quot;speech&quot; : &#123;</span><br><span class="line">                    &quot;ifly&quot; : &#123;&#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h5 id="五、打包"><a href="#五、打包" class="headerlink" title="五、打包"></a>五、打包</h5><p>选择上面菜单栏的发行，原生App在线云端打包</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/10.png" alt="10"></p>
<p>选择完之后就来到这个位置。</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/11.png" alt="11"></p>
<p>上面如果选择了自己的证书 下面的（证书别名、私钥密码、证书文件）都需要填写自己的。</p>
<p>因为我这里没有证书我就选择了 使用DCloud公用证书。下面的的信息就不需要填写。这里都填写好之后就可以点击下面的打包按钮。进行app打包了。</p>
<p>打包成功后会显示</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/12.png" alt="12"></p>
<p>成功之后就可以在控制台看到如下app在队列中的信息。</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/13.png" alt="13"></p>
<p>等待完成之后就可以下载你的apx文件了。</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/14.png" alt="14"></p>
<p>下载完成之后</p>
<p><img src="/2018/10/25/使用Hbuilder构建跨平台的移动app/15.png" alt="15"></p>
<p>这样打包工作就完成了。</p>
<p>Ios的打包前面的操作都是一样的就后面的配置有一些区别按照要求进行配置就好。</p>
<p>原创出品，喜欢可以收藏转载哦！！！</p>
<blockquote>
<p>作者：lizhonglin</p>
<p><strong>github:</strong> <a href="https://github.com/Leezhonglin/" target="_blank" rel="noopener">https://github.com/Leezhonglin/</a></p>
<p><strong>blog:</strong> <a href="https://leezhonglin.github.io/" target="_blank" rel="noopener">https://leezhonglin.github.io/</a></p>
</blockquote>

      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div></div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/WechatIMG26.jpeg" alt="Mr. Lee 微信支付"/>
        <p>微信支付</p>
      </div>
    

    

    

  </div>
</div>

      </div>
    

    

    <div>
      
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">
            -------------本文结束
            <i class="fa fa-paw"></i>
            感谢您的阅读-------------
        </div>
    
</div>
      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Hbuilder构建跨平台的移动app/" rel="tag"><i class="fa fa-tag"></i> Hbuilder构建跨平台的移动app</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/10/25/NSIS打包electron生成的文件为exe安装包/" rel="next" title="NSIS打包electron生成的文件为exe安装包">
                <i class="fa fa-chevron-left"></i> NSIS打包electron生成的文件为exe安装包
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/10/31/python操作sqlserver的数据到mysql的实例/" rel="prev" title="python操作sqlserver的数据到mysql的实例">
                python操作sqlserver的数据到mysql的实例 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/avatar.png"
                alt="Mr. Lee" />
            
              <p class="site-author-name" itemprop="name">Mr. Lee</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">33</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">30</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/Leezhonglin" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:380604322@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>

              <ul class="links-of-blogroll-list">

                
                    <span class="links-of-author-item" style="text-align:center">
                      <a href="https://my.csdn.net/jackfrued/" title="大 神" target="_blank">
                        大 神
                      </a>
                    </span>
                
                    <span class="links-of-author-item" style="text-align:center">
                      <a href="https://blog.csdn.net/qq_33196814" title="CSDN" target="_blank">
                        CSDN
                      </a>
                    </span>
                
                    <span class="links-of-author-item" style="text-align:center">
                      <a href="http://www.python.org" title="python" target="_blank">
                        python
                      </a>
                    </span>
                
                    <span class="links-of-author-item" style="text-align:center">
                      <a href="http://redisdoc.com/" title="redis" target="_blank">
                        redis
                      </a>
                    </span>
                

              </ul>


            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-5"><a class="nav-link" href="#一、安装Hbuilder"><span class="nav-number">1.</span> <span class="nav-text">一、安装Hbuilder</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#二、打开Hbuilder"><span class="nav-number">2.</span> <span class="nav-text">二、打开Hbuilder</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#三、编辑好项目代码"><span class="nav-number">3.</span> <span class="nav-text">三、编辑好项目代码</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#四、进行manifest-json配置"><span class="nav-number">4.</span> <span class="nav-text">四、进行manifest.json配置</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#基础配置"><span class="nav-number">4.1.</span> <span class="nav-text">基础配置</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#图标配置"><span class="nav-number">4.2.</span> <span class="nav-text">图标配置</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#启动图配置"><span class="nav-number">4.3.</span> <span class="nav-text">启动图配置</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#SDK配置"><span class="nav-number">4.4.</span> <span class="nav-text">SDK配置</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#模块权限配置"><span class="nav-number">4.5.</span> <span class="nav-text">模块权限配置</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#源码视图"><span class="nav-number">4.6.</span> <span class="nav-text">源码视图</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#五、打包"><span class="nav-number">5.</span> <span class="nav-text">五、打包</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Mr. Lee</span>

  
</div>


  <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://github.com/Leezhonglin">Leezhonglin</a> 提供技术支持</div>



  <span class="post-meta-divider">|</span>


<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_uv">
  本站访客数:<span id="busuanzi_value_site_uv"></span>
</span>


  <span class="post-meta-divider">|</span>


<span id="busuanzi_container_site_pv">
    本站总访问量:<span id="busuanzi_value_site_pv"></span>次
</span>


  <span class="post-meta-divider">|</span>


</div>


<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共:64.5k字</span>
</div>


  <span class="post-meta-divider">|</span>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

</body>
</html>
